//
//  KLUtils.h
//  Base
//
//  Created by zhusanbao on 2020/10/18.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface KLUtils : NSObject

#pragma mark - sw
//替换对象方法
void replaceInstanceMethods(Class className,SEL newSEL,SEL origSEL);

//替换类方法
void replaceClassMethods(Class className,SEL newSEL,SEL origSEL);

/** 打开控制器  */
BOOL showController(UIViewController *vc,BOOL animate,void (^_Nullable completion)(void));
/** 打开并替换当前控制器  */
BOOL replaceController(UIViewController *fromVc, UIViewController *toVc, BOOL animate,void (^_Nullable completion)(void));
BOOL replaceControllers(NSArray <UIViewController *>*fromVcs, UIViewController *_Nullable toVc, BOOL animate,void (^_Nullable completion)(void));
/** 打开并替换当前控制器所在的导航控制器的最后一个控制器  */
BOOL replaceLastController(UIViewController *fromVc, UIViewController *toVc, BOOL animate,void (^_Nullable completion)(void));
/** 当前导航控制器  */
UINavigationController  *currentNavigationController(void);
/** 当前顶部控制器  */
UIViewController        *currentTopViewController(void);
/** alert提醒  */
void klAlert(NSString * _Nullable title, NSString *_Nullable msg, id titles, void(^_Nullable complete)(NSInteger idx));
/** alert文本框  */
void klAlertTextFiled(NSString *_Nullable title, NSString *_Nullable msg, NSArray *tfblocks,NSArray *btns, void(^_Nullable complete)(NSInteger idx));
/** action sheet  */
void klActions(NSString * _Nullable title, NSString * _Nullable msg, NSArray *titles, void(^_Nullable complete)(NSInteger idx));

@end

NS_ASSUME_NONNULL_END
